Memory address protection circuit and method

ABSTRACT

A circuit includes: a single-port memory interface which includes a sole address port configured to receive a read/write (RW) address, and a multi-port memory which has multiple address ports coupled to the sole address port of the single-port memory interface, and which is configured to store a data unit and parity bits, some of the parity bits being based on the corresponding RW address; a first decoding circuit configured to generate a decoded write address from the RW address and the parity bits; and an error detecting circuit configured to determine if an address error exists based on a comparison of the decoded write address to the read address.

PRIORITY CLAIM

The present application is a continuation of U.S. application Ser. No. 15/622,408, filed Jun. 14, 2017, which claims the priority of U.S. Provisional Application No. 62/427,684, filed Nov. 29, 2016, which are incorporated herein by reference in their entireties.

BACKGROUND

Applications involving memory circuits frequently employ approaches to protect memory data and addresses against faults that can cause functional errors. The approaches include on-line and off-line fault detection and error correction.

With on-line approaches based on error correcting code (ECC), permanent, transient, intermittent, and latent faults are potentially identified and corrected during functional operation. With off-line approaches based on dedicated hardware and/or software, errors are addressed during power-on sequences or other situations in which a circuit is not engaged in functional activities.

BRIEF DESCRIPTION OF THE DRAWINGS

Aspects of the present disclosure are best understood from the following detailed description when read with the accompanying figures. It is noted that, in accordance with the standard practice in the industry, various features are not drawn to scale. In fact, the dimensions of the various features may be arbitrarily increased or reduced for clarity of discussion.

FIG. 1 is a diagram of a memory circuit, in accordance with some embodiments.

FIG. 2 is a diagram of a memory circuit, in accordance with some embodiments.

FIG. 3 is a diagram of a memory circuit, in accordance with some embodiments.

FIG. 4 is a diagram of a memory circuit, in accordance with some embodiments.

FIG. 5 is a flowchart of a method of protecting a memory circuit, in accordance with some embodiments.

DETAILED DESCRIPTION

The following disclosure provides many different embodiments, or examples, for implementing different features of the provided subject matter. Specific examples of components, values, operations, materials, arrangements, or the like, are described below to simplify the present disclosure. These are, of course, merely examples and are not intended to be limiting. Other components, values, operations, materials, arrangements, or the like, are contemplated. For example, the formation of a first feature over or on a second feature in the description that follows may include embodiments in which the first and second features are formed in direct contact, and may also include embodiments in which additional features may be formed between the first and second features, such that the first and second features may not be in direct contact. In addition, the present disclosure may repeat reference numerals and/or letters in the various examples. This repetition is for the purpose of simplicity and clarity and does not in itself dictate a relationship between the various embodiments and/or configurations discussed.

Further, spatially relative terms, such as “beneath,” “below,” “lower,” “above,” “upper” and the like, may be used herein for ease of description to describe one element or feature's relationship to another element(s) or feature(s) as illustrated in the figures. The spatially relative terms are intended to encompass different orientations of the device in use or operation in addition to the orientation depicted in the figures. The apparatus may be otherwise oriented (rotated 90 degrees or at other orientations) and the spatially relative descriptors used herein may likewise be interpreted accordingly.

A memory circuit includes a memory, an address port, a decoding circuit, and an error detecting circuit. The memory stores bits of data in the form of a data unit and parity bits, the address port receives a read address associated with the stored data unit, the decoding circuit generates a decoded write address from the read address and the parity bits, and the error detecting circuit compares the read address with the decoded write address to determine if an address error exists. In some embodiments, the parity bits are generated from the write address and data unit, and in other embodiments, the parity bits are generated from the write address only. In some embodiments, the address port is a read address port and the memory circuit includes a write address port separate from the read address port, and in other embodiments, the address port also receives a write address in a write operation. In some embodiments, the memory is a read-only memory (ROM), and the parity bits are generated as part of a ROM programming process.

FIG. 1 is a diagram of a memory circuit 100, in accordance with some embodiments. Memory circuit 100 includes a memory 110, an encoding circuit 130, a decoding circuit 150, and an error detecting circuit 160. A write address port 101 is configured to receive a write address W_ADD, a data input port 103 is configured to receive a data unit D_U to be stored in memory 110 at the location specified by write address W_ADD, and a read address port 105 is configured to receive a read address R_ADD that identifies the location at which data unit D_U is stored.

Memory 110 is configured to receive write address W_ADD on write address port 101, data unit D_U on data input port 103, and read address R_ADD on read address port 105. Memory 110 is also configured to receive one or more parity bits P_B from encoding circuit 130 on a parity bit port 131.

Memory 110 is configured to store data, including data unit D_U, in a memory portion 111, and to store parity data, including parity bits P_B, in a memory portion 113. Memory 110 is configured to store data unit D_U and parity bits P_B at one or more locations determined based on write address W_ADD on write address port 101, and to retrieve stored data unit D_U and parity bits P_B from the one or more locations in response to read address R_ADD on read address port 105.

In some embodiments, memory 110 is configured to store data unit D_U and parity bits P_B as a single word, with data unit D_U stored at a location in memory portion 111 adjacent to a location at which parity bits P_B are stored in memory portion 113. In some embodiments, data unit D_U is stored in memory portion 111 at a location that is separate from a location at which parity bits P_B are stored in memory portion 113.

In some embodiments, memory 110 is a multi-port memory. In some embodiments, memory 110 is a dual-port memory. In some embodiments, memory 110 is a random-access memory (RAM). In some embodiments, memory 110 is a static random-access memory (SRAM). In some embodiments, memory 110 is a dynamic random-access memory (DRAM).

In one or more embodiments, memory 110 includes circuits (not shown) such as one or more control circuits, one or more address decoding circuits, one or more input/output circuits, and/or one or more additional circuits configured to perform other functions associated with operation of memory 110.

Encoding circuit 130 is a logic circuit configured to receive write address W_ADD on write address port 101 and to receive data unit D_U on data input port 103. Encoding circuit 130 is configured to apply ECC to write address W_ADD and data unit D_U to generate parity bits P_B. ECC is logic that produces parity or other bits usable to identify and/or correct errors in the bits to which it is applied. Encoding circuit 130 is configured to output parity bits P_B on parity bit port 131.

In some embodiments, encoding circuit 130 comprises hardware configured to execute ECC. In some embodiments, encoding circuit 130 comprises a combination of hardware and software configured to execute ECC.

In some embodiments, write address W_ADD includes 10 bits of data. In other embodiments, W_ADD includes more than or fewer than 10 bits of data. In some embodiments, data unit D_U includes 32 bits of data. In other embodiments, data unit D_U includes more than or fewer than 32 bits of data. In some embodiments, parity bits P_B include 7 bits of data. In other embodiments, parity bits P_B include more than or fewer than 7 bits of data.

Memory 110 is configured to output a retrieved data unit R_D_U and retrieved parity bits R_P_B on a memory output port 151. Decoding circuit 150 is configured to receive retrieved stored data unit R_D_U and retrieved parity bits R_P_B on memory output port 151 and to receive read address R_ADD on read address port 105.

Decoding circuit 150 is configured to apply ECC to retrieved data unit R_D_U, retrieved parity bits R_P_B, and read address R_ADD. In some embodiments, decoding circuit 150 comprises hardware configured to execute ECC. In some embodiments, decoding circuit 150 comprises a combination of hardware and software configured to execute ECC.

Based on ECC applied to retrieved data unit R_D_U and retrieved parity bits R_P_B, decoding circuit 150 is configured to output retrieved data unit R_D_U on a data output port 153 and to output an error signal D ERR on a data error port 155. In some embodiments, decoding circuit 150 is configured to correct one or more errors in retrieved data unit R_D_U before outputting retrieved data unit R_D_U on data output port 153. Decoding circuit 150 is configured to output error signal D ERR on data error port 155 indicative of ECC detecting an error in retrieved data unit R_D_U. In some embodiments, decoding circuit 150 is not configured to output error signal D ERR on data error port 155.

Based on ECC applied to retrieved parity bits R_P_B and received read address R_ADD, decoding circuit 150 is configured to generate and output a decoded write address D_W_ADD on a decode output port 157. Encoding circuit 130 and decoding circuit 150 are configured so that, in the absence of a detectible error in the original write address W_ADD on write address port 101 or read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 157 is a replica of the original write address W_ADD received on write address port 101. Encoding circuit 130 and decoding circuit 150 are configured so that, if an error is detected in either write address W_ADD on write address port 101 or read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 157 is not a replica of write address W_ADD on write address port 101. Additional details regarding decoding are disclosed in commonly assigned U.S. Pat. No. 7,779,334, granted Aug. 17, 2010, commonly assigned U.S. Pat. No. 8,301,959, granted Oct. 30, 2012, commonly assigned U.S. Pat. No. 8,464,136, granted Jun. 11, 2013, and U.S. Pat. No. 5,173,905, granted Dec. 22, 1992, the entireties of each of which are hereby incorporated by reference.

In a non-limiting example, in operation, decoding circuit 150 applies ECC to read address R_ADD on read address port 105 to produce regenerated parity bits. If no error exists in either write address W_ADD on write address port 101 or read address R_ADD on read address port 105, the regenerated parity bits are identical to retrieved parity bits R_P_B on memory output port 151, and read address R_ADD is output as decoded write address D_W_ADD on decode output port 157. If an error exists in either write address W_ADD on write address port 101 or read address R_ADD on read address port 105, the regenerated parity bits are not identical to retrieved parity bits R_P_B on memory output port 151. In this case, ECC is applied to read address R_ADD on read address port 105 by decoding circuit 150 such that decoding circuit 150 generates and outputs decoded write address D_W_ADD on decode output port 157 as a corrected version of read address R_ADD, the correction being designed so that decoded write address D_W_ADD produces parity bits identical to retrieved parity bits R_P_B.

Error detecting circuit 160 is configured to receive decoded write address D_W_ADD on decode output port 157 and to receive read address R_ADD on read address port 105. Error detecting circuit 160 is configured to compare decoded write address D_W_ADD on decode output port 157 with read address R_ADD on read address port 105, determine if an address error exists, and generate an error signal A_ERR indicative of a result of the comparison. Error detecting circuit 160 is configured to output error signal A_ERR on an address error port 161. In some embodiments, error detecting circuit 160 is configured to output error signal A_ERR on address error port 161 indicating an error if decoded write address D_W_ADD on decode output port 157 is not equal to read address R_ADD on read address port 105.

Error detecting circuit 160 includes hardware configured to perform a comparison of decoded write address D_W_ADD on decode output port 157 with read address R_ADD on read address port 105 and to generate error signal A_ERR. In some embodiments, error detecting circuit includes one or more logic gates.

Memory circuit 100 is thereby configured so that, in operation, the existence of an address error is determined from decoded write address D_W_ADD on decode output port 157 and read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 157 being based on read address R_ADD on read address port 105 and parity bits P_B generated from the original write address W_ADD on write address port 101.

In some embodiments, by relying on decoded write addresses such as decoded write address D_W_ADD on decode output port 157 and received read addresses such as read address R_ADD on read address port 105, memory circuit 100 detects address errors without storing write addresses in memory. Memory circuit 100 therefore facilitates error detection and correction with a smaller memory size than memory circuits in which write addresses are stored in memory.

FIG. 2 is a diagram of a memory circuit 200, in accordance with some embodiments. Memory circuit 200 includes error detecting circuit 160, write address port 101, data input port 103, and read address port 105, described above with respect to memory circuit 100 and FIG. 1. Memory circuit 200 also includes a memory 210, an encoding circuit 220, an encoding circuit 230, a decoding circuit 240, and a decoding circuit 250.

Memory circuit 200 is similar to memory circuit 100, but is configured to generate, store, and retrieve parity bits for addresses separately from parity bits for data. Thus, in memory circuit 200, encoding circuit 220 and encoding circuit 230 replace encoding circuit 130, and decoding circuit 240 and decoding circuit 250 replace decoding circuit 150.

Memory 210 includes each of the features of memory 110, described above with respect to memory circuit 100, and the description below is limited to the features of memory 210 that differ from those of memory 110.

Memory 210 is configured to receive address parity bits A_P_B from encoding circuit 230 on a parity bit port 231, and to receive data parity bits D_P_B from encoding circuit 220 on a parity bit port 221. In some embodiments, parity bit port 231 and parity bit port 221 are arranged as a single parity bit port.

Memory 210 is configured to store data, including data unit D_U, in a memory portion 211, to store parity data, including data parity bits D_P_B, in a memory portion 213, and to store parity data, including address parity bits A_P_B, in a memory portion 215. Memory 210 is configured to store data unit D_U, address parity bits A_P_B, and data parity bits D_P_B at one or more locations determined by write address W_ADD on write address port 101, and to retrieve stored data unit D_U, address parity bits A_P_B, and data parity bits D_P_B from the one or more locations in response to read address R_ADD on read address port 105.

In some embodiments, memory 210 is configured to store data unit D_U, data parity bits D_P_B, and address parity bits A_P_B as a single word, with data unit D_U stored at a location in memory portion 211 adjacent to locations at which data parity bits D_P_B are stored in memory portion 213 and at which address parity bits A_P_B are stored in memory portion 215. In some embodiments, one or more of data unit D_U, data parity bits D_P_B, or address parity bits A_P_B is stored in memory 210 at one or more locations separate from one or more locations at which another one or more of data unit D_U, data parity bits D_P_B, or address parity bits A_P_B are stored.

Encoding circuit 220 is a logic circuit configured to receive data unit D_U on data input port 103 and apply ECC to data unit D_U to generate data parity bits D_P_B. Encoding circuit 220 is configured to output data parity bits D_P_B on parity bit port 221. In some embodiments, data parity bits D_P_B include 6 bits of data. In other embodiments, data parity bits D_P_B include more than or fewer than 6 bits of data.

Encoding circuit 230 is a logic circuit configured to receive write address W_ADD on write address port 101 and to apply ECC to write address W_ADD to generate address parity bits A_P_B. Encoding circuit 230 is configured to output address parity bits A_P_B on parity bit port 231. In some embodiments, address parity bits A_P_B include 2 bits of data. In other embodiments, address parity bits A_P_B include one bit of data or more than 2 bits of data.

In some embodiments, encoding circuit 220 and encoding circuit 230 are arranged as a single encoding circuit configured to receive data unit D_U on data input port 103 and write address W_ADD on write address port 101 and to generate and output data parity bits D_P_B on parity bit port 221 and address parity bits A_P_B on parity bit port 231.

Memory 210 is configured to output retrieved data unit R_D_U and retrieved data parity bits RD PB on a memory output port 241. Decoding circuit 240 is configured to receive retrieved data unit R_D_U and retrieved data parity bits RD PB on memory output port 241.

Based on ECC applied to retrieved data unit R_D_U and retrieved data parity bits R_D_P_B, decoding circuit 240 is configured to output retrieved data unit R_D_U on a data output port 243 and to output error signal D ERR on a data error port 245. In some embodiments, decoding circuit 240 is configured to correct one or more errors in retrieved data unit R_D_U before outputting retrieved data unit R_D_U on data output port 243. Decoding circuit 240 is configured to output error signal D ERR on data error port 245 indicative of ECC detecting an error in retrieved data unit R_D_U. In some embodiments, decoding circuit 240 is not configured to output error signal D ERR on data error port 245.

Memory 210 is configured to output retrieved address parity bits R_A_P_B on a memory output port 251. Decoding circuit 250 is configured to receive retrieved address parity bits R_A_P_B on memory output port 251 and to receive read address R_ADD on read address port 105.

Decoding circuit 250 includes each of the features related to generation and output of decoded write address D_W_ADD described above with respect to decoding circuit 150, except that retrieved address parity bits R_A_B_P on memory output port 251 replace retrieved parity bits R_P_B on memory output port 151. Accordingly, based on ECC applied to retrieved address parity bits R_A_P_B and received read address R_ADD, decoding circuit 250 is configured to output decoded write address D_W_ADD on a decode output port 253.

Encoding circuit 230 and decoding circuit 250 are thereby configured so that, in the absence of a detectible error in either write address W_ADD on write address port 101 or read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 253 is a replica of write address W_ADD on write address port 101. Encoding circuit 230 and decoding circuit 250 are thereby configured so that, if an error is detected in either write address W_ADD on write address port 101 or read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 253 is not a replica of write address W_ADD on write address port 101.

Error detecting circuit 160 is configured to receive decoded write address D_W_ADD on decode output port 253. Otherwise, error detecting circuit 160 is configured as described above with respect to memory circuit 100.

In some embodiments, decoding circuit 240 and decoding circuit 250 are arranged as a single decoding circuit configured to receive retrieved data unit R_D_U and retrieved data parity bits RD PB on memory output port 241, and retrieved address parity bits R_A_P_B on memory output port 251, and to generate and output retrieved data unit R_D_U on data output port 243, error signal D ERR on data error port 245, and decoded write address D_W_ADD on decode output port 253. Although a single decoding circuit requires a smaller area than separate decoding circuits, separate decoding circuits are able to provide more efficient and robust debugging and diagnostic capability compared to a single decoding circuit.

Memory circuit 200 is thereby configured so that, in operation, the existence of an address error is determined from decoded write address D_W_ADD on decode output port 253 and read address R_ADD on read address port 105, decoded write address D_W_ADD on decode output port 253 being based on read address R_ADD on read address port 105 and parity bits P_B generated exclusively from the original write address W_ADD on write address port 101.

By relying on decoded write addresses such as D_W_ADD on decode output port 253 and received read addresses such as R_ADD on read address port 105, memory circuit 200 detects address errors without storing write addresses in memory. Memory circuit 200 therefore facilitates error detection and correction with a smaller memory size than memory circuits in which write addresses are stored in memory. Compared to memory circuit 100, in some embodiments, memory circuit 200 consumes a slightly larger memory area/footprint to store data parity bits and address parity bits separately, and requires a slightly larger area/footprint for separate decoding circuits, but facilitates better fault diagnosis and avoids address fault aliasing.

FIG. 3 is a diagram of a memory circuit 300, in accordance with some embodiments. Memory circuit 300 includes error detecting circuit 160, memory 210, encoding circuit 220, encoding circuit 230, decoding circuit 240, decoding circuit 250, and data input port 103 described above with respect to memory circuits 100 and 200 and FIGS. 1 and 2. Memory circuit 300 also includes a single-port memory interface 310, and a read/write address port 301.

Memory circuit 300 is similar to memory circuit 200, but is configured to receive read/write addresses on a single address port instead of separate read and write addresses on separate address ports. Thus, in memory circuit 300, address port 301 replaces write address port 101 and read address port 105.

Address port 301 is configured to receive a read/write address RW_ADD. Read/write address RW_ADD includes an input address originating at a location external to memory circuit 300 and acts as either a read address or a write address. In some embodiments, memory circuit 300 is configured to respond to read/write address RW_ADD as either a read address or a write address depending on the logical state of a write enable signal (not shown).

Single-port memory interface 310 includes an address port 311 configured to receive read/write address RW_ADD on address port 301 and to provide read/write address RW_ADD to memory 210 in a multi-port configuration. In the embodiment depicted in FIG. 3, memory 210 is a dual-port memory and address port 311 is configured to provide read/write address RW_ADD to memory 210 on two branches of address port 311, represented by two arrows in FIG. 3. In some embodiments, memory 210 is a multi-port memory having more than two ports, and address port 311 is configured to provide read/write address RW_ADD to memory 210 on a number of branches that matches the number of ports of the multi-port memory.

Because memory 210 is either a dual-port memory or a multi-port memory having more than two ports, memory 210 includes two or more address decoder circuits (not shown). As described above with respect to memory circuit 200, the combination of memory 210, encoding circuit 230, decoding circuit 250, and error detecting circuit 160 facilitates the determination of errors on addresses received on separate read and write address ports. By providing read/write address RW_ADD to memory 210 on separate ports, single-port memory interface 310 facilitates the same error detection capability in memory circuit 300.

Memory circuit 300 is thereby configured so that, in a read operation, the existence of an address error is determined from decoded write address D_W_ADD on decode output port 253 and read/write address RW_ADD on address port 301, decoded write address D_W_ADD being based on read/write address RW_ADD on address port 301 and parity bits P_B generated from the read/write address RW_ADD on address port 301 used in a prior write operation.

By having multi-port memory 210 and single-port memory interface 310, in some embodiments, memory circuit 300 facilitates the detection and correction of address errors and avoids address fault aliasing while providing single-port memory functionality to external circuits. Compared to other single-port memory circuits that do not have multi-port memories, memory circuit 300 has improved address error detection at the cost of a larger memory area for the multi-port memory.

FIG. 4 is a diagram of a memory circuit 400, in accordance with some embodiments. Memory circuit 400 includes error detecting circuit 160, decoding circuit 240, decoding circuit 250, and read address port 105, described above with respect to memory circuits 100 and 200 and FIGS. 1 and 2, and a read-only memory (ROM) 410. FIG. 4 also includes a representation of a ROM programmer 420 separate from memory circuit 400.

ROM programmer 420 is a system including a combination of hardware and software configured to generate and program, or write, data bits in a ROM such as ROM 410. In operation, ROM programmer 420 performs an off-line process that includes applying ECC to data unit D_U to generate data parity bits D_P_B and applying ECC to write address W_ADD for data unit D_U to generate address parity bits A_P_B. In operation, the off-line process performed by ROM programmer 420 also includes programming ROM 410 with data unit D_U, data parity bits D_P_B, and address parity bits A_P_B.

As a result of the off-line process performed by ROM programmer 420, ROM 410 is configured to store data, including data unit D_U, in a ROM portion 411, to store parity data, including data parity bits D_P_B, in a ROM portion 413, and to store parity data, including address parity bits A_P_B, in a ROM portion 415. ROM 410 is configured to store data unit D_U, address parity bits A_P_B, and data parity bits D_P_B at one or more locations determined by the write address W_ADD, and to retrieve stored data unit D_U, address parity bits A_P_B, and data parity bits D_P_B from the one or more locations in response to read address R_ADD on read address port 105.

In some embodiments, ROM 410 is configured to store data unit D_U, data parity bits D_P_B, and address parity bits A_P_B as a single word, with data unit D_U stored at a location in ROM portion 411 adjacent to locations at which data parity bits D_P_B are stored in ROM portion 413 and at which address parity bits A_P_B are stored in ROM portion 415. In some embodiments, one or more of data unit D_U, data parity bits D_P_B, or address parity bits A_P_B is stored in ROM 410 at one or more locations separate from one or more locations at which another one or more of data unit D_U, data parity bits D_P_B, or address parity bits A_P_B are stored.

Memory circuit 400 is thereby configured so that, in operation, the existence of an address error is determined from decoded write address D_W_ADD on decode output port 253 and read address R_ADD on read address port 105, decoded write address D_W_ADD being based on read address R_ADD on read address port 105 and parity bits P_B generated from write address W_ADD.

By storing address parity bits and including decoding and error detecting circuits, in some embodiments, memory circuit 400 facilitates the detection and correction of address errors while providing single-port ROM functioning to external circuits. Compared to other ROM circuits that do not have stored address parity bits, in some embodiments, memory circuit 400 has improved address error detection at the cost of a slightly larger ROM area.

FIG. 5 is a flowchart of a method 500 of protecting a memory circuit, in accordance with one or more embodiments. Method 500 is capable of being performed with each of memory circuits 100, 200, 300, or 400, discussed above.

The sequence in which the operations of method 500 are depicted in FIG. 5 is for illustration only; the operations of method 500 are capable of being executed in sequences that differ from that depicted in FIG. 5. In some embodiments, operations in addition to those depicted in FIG. 5 are performed before, between and/or after the operations depicted in FIG. 5.

At operation 510, a write address is generated. In some embodiments, generating the write address is performed by a circuit in communication with a memory circuit and provided to the memory circuit as part of a write operation. In some embodiments, the write address is write address W_ADD described above with respect to memory circuits 100, 200 and 400. In some embodiments, the write address is read/write address RW_ADD described above with respect to memory circuit 300. In some embodiments, operation 510 is optional.

At operation 520, parity bits are generated for the write address. In some embodiments, generating the parity bits is performed based on the write address combined with a data unit associated with the write address. In some embodiments, generating the parity bits is performed based on the write address only. In some embodiments, generating the parity bits is performed by applying ECC to the write address. In some embodiments, operation 520 is optional.

In some embodiments, generating the parity bits is performed using encoding circuit 130, described above with respect to memory circuit 100. In some embodiments, generating the parity bits is performed using encoding circuit 230, described above with respect to memory circuits 200 and 300. In some embodiments, generating the parity bits is performed as part of ROM programming process 420, described above with respect to memory circuit 400.

At operation 530, a data unit and parity bits are stored in a memory. In some embodiments, storing the data unit and parity bits includes storing the data unit and parity bits at adjacent locations in the memory. In some embodiments, storing the data unit and parity bits includes storing the data unit and parity bits at non-adjacent locations in the memory. In some embodiments, operation 530 is optional.

In some embodiments, storing the data unit and parity bits includes storing data unit D_U and parity bits P_B in memory 110, described above with respect to memory circuit 100. In some embodiments, storing the data unit and parity bits includes storing data unit D_U and address parity bits A_P_B in memory 210, described above with respect to memory circuits 200 and 300. In some embodiments, storing the data unit and parity bits is part of the off-line process performed by ROM programmer 420 for ROM 410, described above with respect to memory circuit 400.

At operation 540, a read instruction is received by a memory circuit. In some embodiments, the read instruction is received as part of a read operation of the memory circuit. In some embodiments, the read instruction is received as part of a test of the memory circuit. The read instruction includes a read address for a data unit stored in a memory of the memory circuit.

In some embodiments, the read instruction includes read address R_ADD received on read address port 105, described above with respect to memory circuits 100, 200, or 400. In some embodiments, the read instruction includes read/write address RW_ADD received on read/write address port 301, described above with respect to memory circuit 300.

At operation 550, parity bits are retrieved from a memory. The parity bits are based on a write address for a data unit stored in the memory. In some embodiments, retrieving the parity bits from the memory includes retrieving retrieved parity bits R_P_B from memory 110 on memory output port 151, described above with respect to memory circuit 100. In some embodiments, retrieving the parity bits from the memory includes retrieving retrieved address parity bits R_A_P_B from memory 210 on memory output port 251, described above with respect to memory circuits 200 and 300. In some embodiments, retrieving the parity bits from the memory includes retrieving retrieved parity bits R_A_P_B from ROM 410 on memory output port 251, described above with respect to memory circuit 400.

In some embodiments, operation 550 includes retrieving the data unit from the memory. In some embodiments, operation 550 includes retrieving retrieved data unit R_D_U from memory 110 on memory output port 151, described above with respect to memory circuit 100. In some embodiments, operation 550 includes retrieving retrieved data unit R_D_U from memory 210 on memory output port 241, described above with respect to memory circuits 200 and 300, or from ROM 410 on memory output port 241, described above with respect to memory circuit 400.

At operation 560, a decoded write address is generated from the read address of the read instruction and the retrieved parity bits. In some embodiments, generating the decoded write address is performed by applying ECC to the parity bits based on the write address combined with a data unit. In some embodiments, generating the decoded write address is performed by applying ECC to read address R_ADD on read address port 105 and retrieved parity bits R_P_B on memory output port 151, described above with respect to memory circuit 100.

In some embodiments, generating the decoded write address is performed by applying ECC to the parity bits based on the write address only. In some embodiments, generating the decoded write address is performed by applying ECC to read address R_ADD on read address port 105 and retrieved address parity bits R_A_P_B on memory output port 251, described above with respect to memory circuits 200 and 400. In some embodiments, generating the decoded write address is performed by applying ECC to read/write address RW_ADD on read/write address port 301 and retrieved address parity bits R_A_P_B on memory output port 251, described above with respect to memory circuit 300.

In some embodiments, decoding the write address is performed using decoding circuit 150, described above with respect to memory circuit 100. In some embodiments, decoding the write address is performed using decoding circuit 250, described above with respect to memory circuits 200, 300, or 400.

In some embodiments, operation 560 includes outputting a data unit on a data output port. In some embodiments, outputting a data unit includes outputting retrieved data unit R_D_U on data output port 153 using decoding circuit 150, described above with respect to memory circuit 100. In some embodiments, outputting a data unit includes outputting retrieved data unit R_D_U on data output port 243 using decoding circuit 250, described above with respect to memory circuits 200, 300, or 400.

In some embodiments, operation 560 includes outputting an error signal on a data error port based on detecting an error within a stored data unit. In some embodiments, outputting an error signal includes outputting error signal D ERR on data error port 155 using decoding circuit 150, described above with respect to memory circuit 100. In some embodiments, outputting an error signal includes outputting data error signal D ERR on data error port 245 using decoding circuit 250, described above with respect to memory circuits 200, 300, or 400.

At operation 570, the existence of an address error is determined from the decoded write address and the read address. In some embodiments, determining the existence of an address error includes determining if the decoded write address and the read address are equal. In some embodiments, determining the existence of an address error includes comparing the decoded write address to the read address with a logic circuit. In some embodiments, determining the existence of an address error is performed using error detecting circuit 160, described above with respect to memory circuits 100, 200, 300, or 400.

At operation 580, an error signal is generated based on determining the existence of an address error. In some embodiments, generating the error signal includes generating error signal A_ERR using error detecting circuit 160, described above with respect to memory circuits 100, 200, 300, or 400. In some embodiments, operation 580 is optional.

In some embodiments, operation 580 includes outputting the error signal on an address error port. In some embodiments, outputting the error signal includes outputting error signal A_ERR on address error port 161 using error detecting circuit 160, described above with respect to memory circuits 100, 200, 300, or 400.

At operation 590, an address error is corrected based on determining the existence of an address error. In some embodiments, correcting the address error is performed using one of memory circuits 100, 200, 300, or 400. In some embodiments, correcting the address error is performed using a circuit in communication with one of memory circuits 100, 200, 300, or 400. In some embodiments, operation 590 is optional.

By performing the operations of method 500, the existence of an address error is determined from a decoded write address and a read address, the decoded write address being based on the read address and parity bits generated from the original write address.

By relying on decoded write addresses and received read addresses, method 500 detects address errors without storing write addresses in memory. Method 500 therefore facilitates error detection and correction using a smaller memory size than applications in which write addresses are stored in memory. Method 500 also facilitates dual-port based error detection and correction in single-port memory or ROM applications.

In an embodiment, a memory circuit includes: a single-port memory interface which includes a sole address port configured to receive a read/write (RW) address, and a multi-port memory which has multiple address ports coupled to the sole address port of the single-port memory interface, and which is configured to store a data unit and parity bits, some of the parity bits being based on the corresponding RW address; a first decoding circuit configured to generate a decoded write address from the RW address and the parity bits; and an error detecting circuit configured to determine if an address error exists based on a comparison of the decoded write address to the read address. In an embodiment, the parity bits include first parity bits based on the RW address and second parity bits based on the data unit. In an embodiment, the first parity bits are based on the RW address only. In an embodiment, the second parity bits are based on the data unit only. In an embodiment, the memory circuit further includes: a first encoding circuit configured to generate the first parity bits from the RW address only. In an embodiment, the memory circuit further includes: a second encoding circuit configured to generate the second parity bits from the data unit only. In an embodiment, the memory circuit further includes: a second decoding circuit configured to decode the second parity bits, the second parity bits being based on the stored data unit. In an embodiment, the multi-port memory is a dual-port memory. In an embodiment, the multi-port memory is further configured to store: the data unit, the first parity bits and the second parity bits as a single word; one of the data unit, the first parity bits or the second parity bits in a first location which is separate from a second location of a remaining two of the data unit, the first parity bits or the second parity bits; or the data unit, the first parity bits and the second parity bits at corresponding separate first, second and third locations.

In an embodiment, a memory circuit includes: a read-only memory (ROM) configured to store a data unit, data parity bits associated with the data unit, and address parity bits based on a write address associated with the stored data unit; an address port configured to receive a read address for the stored data unit; a first decoding circuit configured to generate a decoded write address from the read address and the address parity bits; and an error detecting circuit configured to determine if an address error exists based on a comparison of the decoded write address to the read address. In an embodiment, the memory circuit further includes: a second decoding circuit configured to decode the second parity bits, the second parity bits being based on the stored data unit. In an embodiment, the ROM is further configured to store the data unit, data parity bits and address parity bits as a single word.

In an embodiment, a method (of operating a memory which has a single-port memory interface, the single-port memory interface including a sole address port configured to receive a read/write (RW) address; and a multi-port memory which has multiple address ports) includes: receiving, at the sole address port memory interface, a read address for a data unit stored in the multi-port memory; coupling the read address on the sole address port of the single-port memory interface to the multiple address ports of the multi-port memory; retrieving parity bits from the multi-port memory, some of the parity bits being based on the RW address for the stored data unit; generating, using an error detecting circuit, a decoded write address based on the read address and the retrieved parity bits; and determining, using an error detecting circuit, the existence of an address error based on the decoded write address and the read address. In an embodiment, the method further includes: storing the data unit and the parity bits in the multi-port memory. In an embodiment, the method further includes: generating an error signal based on determining existence of an address error. In an embodiment, the method further includes: correcting an address error based on determining existence of an address error. In an embodiment, the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the retrieving parity bits includes using the read address as an index for the first parity bits in the multi-port memory. In an embodiment, the method further includes: using the read address as an index for the data unit in the multi-port memory. In an embodiment, the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the method further includes: generating the first parity bits from the RW address only. In an embodiment, the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the method further includes generating the second parity bits from the data unit only.

The foregoing outlines features of several embodiments so that those skilled in the art may better understand the aspects of the present disclosure. Those skilled in the art should appreciate that they may readily use the present disclosure as a basis for designing or modifying other processes and structures for carrying out the same purposes and/or achieving the same advantages of the embodiments introduced herein. Those skilled in the art should also realize that such equivalent constructions do not depart from the spirit and scope of the present disclosure, and that they may make various changes, substitutions, and alterations herein without departing from the spirit and scope of the present disclosure. 

What is claimed is:
 1. A memory circuit comprising: a single-port memory interface which includes: a sole address port configured to receive a read/write (RW) address; and a multi-port memory which has multiple address ports coupled to the sole address port of the single-port memory interface, and which is configured to store a data unit and parity bits, some of the parity bits being based on the corresponding RW address; a first decoding circuit configured to generate a decoded write address from the RW address and the parity bits; and an error detecting circuit configured to determine if an address error exists based on a comparison of the decoded write address to the read address.
 2. The memory circuit of claim 1, wherein: the parity bits include first parity bits based on the RW address and second parity bits based on the data unit.
 3. The memory circuit of claim 2, wherein the first parity bits are based on the RW address only.
 4. The memory circuit of claim 3, wherein the second parity bits are based on the data unit only.
 5. The memory circuit of claim 2, further comprising a first encoding circuit configured to generate the first parity bits from the RW address only.
 6. The memory circuit of claim 5, further comprising a second encoding circuit configured to generate the second parity bits from the data unit only.
 7. The memory circuit of claim 2, further comprising: a second decoding circuit configured to decode the second parity bits, the second parity bits being based on the stored data unit.
 8. The memory circuit of claim 1, wherein: the multi-port memory is a dual-port memory.
 9. The memory circuit of claim 2, wherein: the multi-port memory is further configured to store: the data unit, the first parity bits and the second parity bits as a single word; one of the data unit, the first parity bits or the second parity bits in a first location which is separate from a second location of a remaining two of the data unit, the first parity bits or the second parity bits; or the data unit, the first parity bits and the second parity bits at corresponding separate first, second and third locations.
 10. A memory circuit comprising: a read-only memory (ROM) configured to store a data unit, data parity bits associated with the data unit, and address parity bits based on a write address associated with the stored data unit; an address port configured to receive a read address for the stored data unit; a first decoding circuit configured to generate a decoded write address from the read address and the address parity bits; and an error detecting circuit configured to determine if an address error exists based on a comparison of the decoded write address to the read address.
 11. The memory circuit of claim 1, further comprising: a second decoding circuit configured to decode the second parity bits, the second parity bits being based on the stored data unit.
 12. The memory circuit of claim 10, wherein: the ROM is further configured to store the data unit, data parity bits and address parity bits as a single word.
 13. A method of operating a memory which has a single-port memory interface, the single-port memory interface including a sole address port configured to receive a read/write (RW) address; and a multi-port memory which has multiple address ports, the method comprising: receiving, at the sole address port memory interface, a read address for a data unit stored in the multi-port memory; coupling the read address on the sole address port of the single-port memory interface to the multiple address ports of the multi-port memory; retrieving parity bits from the multi-port memory, some of the parity bits being based on the RW address for the stored data unit; generating, using an error detecting circuit, a decoded write address based on the read address and the retrieved parity bits; and determining, using an error detecting circuit, the existence of an address error based on the decoded write address and the read address.
 14. The method of claim 13, further comprising: storing the data unit and the parity bits in the multi-port memory.
 15. The method of claim 13, further comprising: generating an error signal based on determining existence of an address error.
 16. The method of claim 13, further comprising: correcting an address error based on determining existence of an address error.
 17. The method of claim 13, wherein: the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the retrieving parity bits includes: using the read address as an index for the first parity bits in the multi-port memory.
 18. The method of claim 17, further comprising: using the read address as an index for the data unit in the multi-port memory.
 19. The method of claim 13, wherein: the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the method further comprises: generating the first parity bits from the RW address only.
 20. The method of claim 13, wherein: the parity bits include first parity bits based on the RW address and second parity bits based on the data unit; and the method further comprises: generating the second parity bits from the data unit only. 